package vehicle;

public class Plane extends Vehicle{
	private String type;

	public Plane() {
		super();
	}
	public Plane(String name, double speed, String type) {
		super(name, speed);
		this.type = type;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	
	@Override
	public double getReachTime(double distance) {
		System.out.println(this.getName() + type + "的飞机速度为" + this.getSpeed()
		    + "公里/小时，到达" + distance + "公里需要" + distance / this.getSpeed() +"小时");
		return distance / this.getSpeed();
	}
}
